README - Jonne Kamphorst July 2023

The 'data' folder contains the datafiles used, the codebooks, and the qualtrics surveys
The 'code used to create datafiles' contains the code that is used to create the data in the data folder (this can't be reproduced due to GDPR reasons)
The other R files in the main folder are analysis files:
	std1_07_analysis   For study 1	
	std2_02_analysis   For study 2
	std3_01_clean_analysis	For study 3
	check_heterogen    Appendix table A3. 


The `WHAT IS REPRODUCED WHERE' file provides an overview of all figures and tables in the paper and in which lines of which R files they can be reproduced. The codebooks and data files can be found in the data folder. 

The 'tables' and 'plots' folders are empty and there so that R can write to these folders.



HOW TO REPRODUCE:
Simply run the R-file 'reproduce_all' file and all the plots and tables will appear in the plots and tables folder. This file needs to be run from within the 'reproduction' R project. Running everything will take about 45 minutes. 



NOTES ON REPRODUCTION:
Almost all the plots and tables will end up in the plots and tables folders. Table A3 can only be re-produced using STATA. Some figures were slightly adjusted post-R to remove the spacing between the different panels or add some additional text on-top of the figures (this can't be done in R). Take a look at the `WHAT IS REPRODUCED WHERE' file, which provides an exact overview of all figures and tables in the paper and in which lines of which R files they can be reproduced. 

Note that std1_07_analysis has several margins_summary() arguments that take about 20 minutes to run each. This will run fine on a normal laptop with at minimum 16GB RAM, it just takes some time. To make re-producing easier, these lines are now blued-out and the output of them is saved in the Rproject so that the reproduction runs a bit faster. The other part that takes long is the mediation analysis (figure 4), this will take about 30 minutes on a standard laptop. 

A windows laptop was used with the latest R version (as of 2023 07 25). 






